package com.example.java;

import com.example.java.thread.MyAsyncService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;

@EnableAsync
@SpringBootApplication
public class JavaApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(JavaApplication.class, args);
        MyAsyncService myAsyncService = context.getBean("myAsyncService", MyAsyncService.class);
//        myAsyncService.asyncMethod();
//        myAsyncService.asyncMethod();
//        myAsyncService.asyncMethod();
        myAsyncService.deadLock();
        myAsyncService.deadLock1();
    }
}
